package com.example.gulimall.cas.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.gulimall.cas.model.UserDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/**
 * <p>@description: 用户  </p>
 * <p>@author: JGD </p>
 * <p>@create: 2020/3/12 10:34 </p>
 * <p>@version : 2.0.0
 **/
@Mapper
@Repository
public interface UserDAO extends BaseMapper<UserDO> {
    /**
     * 根据用户名获取用户信息
     * @param username 用户名
     * @return UserDO
     */
    @Select("select * from tb_user where username = #{username}")
    UserDO selectByUserName(@Param("username") String username);

    /**
     * 根据电话号码获取用户信息
     * @param mobile 手机号
     * @return UserDO
     */
    @Select("select * from tb_user where mobile = #{mobile}")
    UserDO selectByMobile(@Param("mobile") String mobile);
}
